# Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if(CMAKE_CROSSCOMPILING)
    include(FetchContent)

    if("mbed-atomic" IN_LIST IOTSDK_FETCH_LIST)
        # This component is hosted in the mcu-driver-hal repository.
        FetchContent_MakeAvailable(mcu-driver-hal)
    endif()

    if(mcu-driver-hal_POPULATED)
        # Drop the suffix to make the name more precise and shorter.
        add_library(mbed-atomic ALIAS mbed-atomic-api)
    endif()
endif() # CMAKE_CROSSCOMPILING
